---
image: /generated/articles-docs-media-parser-types.png
id: types
sidebar_label: Types
title: TypeScript Types Reference
slug: /media-parser/types
crumb: '@remotion/media-parser'
---

:::warning
[We are phasing out Media Parser and are moving to Mediabunny](/blog/mediabunny)!
:::

The following types are part of the stable API of `@remotion/media-parser`:

## `MediaParserDimensions`

```tsx twoslash
import type {MediaParserDimensions} from '@remotion/media-parser';
//                ^?
```

## `MediaParserAudioCodec`

```tsx twoslash
import type {MediaParserAudioCodec} from '@remotion/media-parser';
//                ^?
```

More values may be added in the future, this would not be considered a breaking change.

## `MediaParserVideoCodec`

```tsx twoslash
import type {MediaParserVideoCodec} from '@remotion/media-parser';
//                ^?
```

More values may be added in the future, this would not be considered a breaking change.

## `MediaParserContainer`

```tsx twoslash
import type {MediaParserContainer} from '@remotion/media-parser';
//                ^?
```

More values may be added in the future, this would not be considered a breaking change.

## `MediaParserLocation`

```tsx twoslash
import type {MediaParserLocation} from '@remotion/media-parser';
//                ^?
```

## `MediaParserEmbeddedImage`

```tsx twoslash
import type {MediaParserEmbeddedImage} from '@remotion/media-parser';
//                ^?
```

- `mimeType`: The MIME type of the image, or `null`
- `description`: A description of the image, or `null`
- `data`: The image data as a `Uint8Array`

## `MediaParserKeyframe`

```tsx twoslash
import type {MediaParserKeyframe} from '@remotion/media-parser';
//                ^?
```

- `presentationTimeInSeconds`: The time in seconds when the keyframe should be presented
- `decodingTimeInSeconds`: The time in seconds when the keyframe should be decoded
- `positionInBytes`: The position in bytes where the keyframe is located in the file
- `sizeInBytes`: The size of the keyframe in bytes
- `trackId`: The ID of the track the frame belongs to

## `MediaParserLogLevel`

```tsx twoslash
import type {MediaParserLogLevel} from '@remotion/media-parser';
//                ^?
```

## `MediaParserMetadataEntry`

```tsx twoslash
import type {MediaParserMetadataEntry} from '@remotion/media-parser';
//                ^?
```

## `MediaParserAudioSample`

```tsx twoslash
import type {MediaParserAudioSample} from '@remotion/media-parser';
//                ^?
```

## `MediaParserOnAudioSample`

```tsx twoslash
import type {MediaParserOnAudioSample} from '@remotion/media-parser';
//                ^?
```

The `data`, `timestamp`, `duration`, `type` fields are in a format so that this type can be passed into the [`EncodedAudioChunk`](https://developer.mozilla.org/en-US/docs/Web/API/EncodedAudioChunk) constructor.

The other fields are for informative purposes.

## `MediaParserVideoSample`

```tsx twoslash
import type {MediaParserVideoSample} from '@remotion/media-parser';
//                ^?
```

Note: `timestamp` is the presentation timestamp of the sample. `decodingTimestamp` is the timestamp of the sample when it will be decoded.

The `data`, `timestamp`, `duration`, `type` fields are in a format so that this type can be passed into the [`EncodedVideoChunk`](https://developer.mozilla.org/en-US/docs/Web/API/EncodedVideoChunk) constructor.

The other fields are for informative purposes.

## `MediaParserOnVideoSample`

```tsx twoslash
import type {MediaParserOnVideoSample} from '@remotion/media-parser';
//                ^?
```

## `MediaParserAudioTrack`

```tsx twoslash
import type {MediaParserAudioTrack} from '@remotion/media-parser';
//                ^?
```

## `MediaParserOnAudioTrackParams`

```tsx twoslash
import type {MediaParserOnAudioTrackParams} from '@remotion/media-parser';
//                ^?
```

## `MediaParserOnVideoTrackParams`

```tsx twoslash
import type {MediaParserOnVideoTrackParams} from '@remotion/media-parser';
//                ^?
```

## `MediaParserAdvancedColor`

```tsx twoslash
import type {MediaParserAdvancedColor} from '@remotion/media-parser';
//                ^?
```

## `MediaParserMatrixCoefficients`

```tsx twoslash
import type {MediaParserMatrixCoefficients} from '@remotion/media-parser';
//                ^?
```

More values may be added in the future, this would not be considered a breaking change.

## `MediaParserPrimaries`

```tsx twoslash
import type {MediaParserPrimaries} from '@remotion/media-parser';
//                ^?
```

More values may be added in the future, this would not be considered a breaking change.

## `MediaParserTransferCharacteristics`

```tsx twoslash
import type {MediaParserTransferCharacteristics} from '@remotion/media-parser';
//                ^?
```

More values may be added in the future, this would not be considered a breaking change.

## `MediaParserVideoTrack`

```tsx twoslash
import {MediaParserVideoCodec, MediaParserCodecData, MediaParserSampleAspectRatio, MediaParserAdvancedColor} from '@remotion/media-parser';

export type MediaParserVideoTrack = {
  // WebCodecs
  codec: string;
  description: Uint8Array | undefined;
  colorSpace: VideoColorSpaceInit;
  codedWidth: number;
  codedHeight: number;
  displayAspectWidth: number;
  displayAspectHeight: number;
  // Non-WebCodecs
  type: 'video';
  trackId: number;
  codecEnum: MediaParserVideoCodec;
  codecData: MediaParserCodecData | null;
  sampleAspectRatio: MediaParserSampleAspectRatio;
  width: number;
  height: number;
  rotation: number;
  fps: number | null;
  timescale: number;
  advancedColor: MediaParserAdvancedColor;
  m3uStreamFormat: 'ts' | 'mp4' | null;
  // When the track starts in seconds - can be non-zero for MP4 containers.
  // You don't need to account for it, as the samples will already be offset by this amount.
  startInSeconds: number;
};
```

See: [`VideoColorSpaceInit`](https://developer.mozilla.org/en-US/docs/Web/API/VideoColorSpaceInit) WebCodecs definition

## `MediaParserAudioTrack`

```tsx twoslash
import type {MediaParserAudioTrack} from '@remotion/media-parser';
//                ^?
```

## `MediaParserOtherTrack`

```tsx twoslash
import type {MediaParserOtherTrack} from '@remotion/media-parser';
//                ^?
```

## `MediaParserTrack`

```tsx twoslash
import type {MediaParserTrack} from '@remotion/media-parser';
//                ^?
```

## `MediaParserSampleAspectRatio`

```tsx twoslash
import type {MediaParserSampleAspectRatio} from '@remotion/media-parser';
//                ^?
```

## `MediaParserOnVideoTrack`

```tsx twoslash
import type {MediaParserOnVideoTrack} from '@remotion/media-parser';
//                ^?
```

## `MediaParserOnAudioTrack`

```tsx twoslash
import type {MediaParserOnAudioTrack} from '@remotion/media-parser';
//                ^?
```

## `MediaParserOnVideoTrackParams`

```tsx twoslash
import type {MediaParserOnVideoTrackParams} from '@remotion/media-parser';
//                ^?
```

## `MediaParserOnAudioTrackParams`

```tsx twoslash
import type {MediaParserOnAudioTrackParams} from '@remotion/media-parser';
//                ^?
```

## `ParseMediaSrc`

```tsx twoslash
import type {ParseMediaSrc} from '@remotion/media-parser';
//                ^?
```

## `M3uStream`

```tsx twoslash
import type {M3uStream} from '@remotion/media-parser';
//                ^?
```

- `bandwidthInBitsPerSec`: The bandwidth of the stream. May be `null`.
- `averageBandwidthInBitsPerSec`: The average bandwidth of the stream. May be `null`.
- `resolution`: The resolution of the stream. May be `null`.
- `codecs`: The codec strings of the stream as an array May be `null`.
- `src`: The URL or file path of the stream
- `id`: A unique identifier that Remotion gives the stream
- `associatedPlaylists`: An array of [`M3uAssociatedPlaylist`](/docs/media-parser/types#m3uassociatedplaylist) - other (probably audio) tracks that are connected to this stream but live in a separate file.

## `M3uAssociatedPlaylist`

```tsx twoslash
import type {M3uAssociatedPlaylist} from '@remotion/media-parser';
//                ^?
```

- `src`: The URL or file path of the audio track
- `autoselect`: Corresponds to the `AUTOSELECT` attribute in the HLS playlist
- `default`: Corresponds to the `DEFAULT` attribute in the HLS playlist
- `language`: The language of the audio track
- `name`: The name of the audio track
- `groupId`: The group ID of the audio track
- `channels`: The number of audio channels in the audio track, or `null`.

## `SeekResolution`<AvailableFrom v="4.0.312" />

```tsx twoslash
import type {SeekResolution} from '@remotion/media-parser';
//                ^?
```
